<template>
	<!-- 司机认证 -->
	<view class="total">

		<view class="kapian">
			<uni-card :is-shadow="false">
				<view class="shang">
					<uni-section class="mb-10" title="实名认证" type="line" titleFontSize="16px"
						:padding="false"></uni-section>
				</view>

				<view class="xia">
					<text>需上传身份证正反面</text>
					<view v-if="showInfo">
						<uni-tag text="已通过" :circle="true" size="normal"
							custom-style="background-color: #e7f3f4; border-color: #F0FFFF; color: #13d088;font-weight:500;">
						</uni-tag>
					</view>

					<view v-if="downIfo">
						<uni-tag :circle="true" text="去认证" type="primary" @click="shiming()" />
					</view>

				</view>
			</uni-card>
		</view>
		
		<view class="kapian">
			<uni-card :is-shadow="false">
				<view class="shang">
					<uni-section class="mb-10" title="驾驶证认证" type="line" titleFontSize="16px"
						:padding="false"></uni-section>
				</view>
		
				<view class="xia">
					<text>需上传行驶证、道路运输证、经营许可证</text>
					<uni-tag :circle="true" text="去认证" type="primary" @click="jiashizheng()" />
				</view>
			</uni-card>
		</view>

	</view>
</template>

<script>
	export default {
		data( ) {
			return {
				showInfo: false,
				downIfo: true,
				phone: '17635711209'
			}
		},
		created(){
			this.selectRenZheng()
		},
		methods: {
			shiming( ) {
				uni.navigateTo( {
					url: '/pages/mine/real-name'
				} )
			},
			jiashizheng( ) {
				uni.navigateTo( {
					url: '/pages/mine/driving-licence'
				} )
			},
			async selectRenZheng() {
				console.log(11111)
				const result = await uni.$http.get(
					"localhost:8099/tsRealNameAuthentication/selectRealNameByPhone/" + this.phone);
				const {
					data,
					code
				} = result.data
				if (code == 101) {
					this.showInfo = true
					this.downIfo = false
				} else if (code == 102) {
					this.showInfo = false
					this.downIfo = true
				}
			}
		}
	}
</script>

<style>
	.total {
		display: flex;
		flex-direction: column;
	}

	.card-style {
		display: flex;
		/* align-self: center; */
		flex-direction: row;
	}

	.shuxian {
		padding-left: 0px;
	}

	.shang {}

	.xia {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding-bottom: 10px;
	}

	.kapian {
		margin: -10px 0;
	}

	.kapian:nth-child(1) {
		margin-top: 5px;
	}

	.kapian:nth-child(2) {
		margin-bottom: -5px;
	}

	/deep/ .uni-section .uni-section-header[data-v-f7ca1098] {
		position: relative;
		display: flex;
		flex-direction: row;
		align-items: center;
		padding: 10px 0;
		font-weight: bold;
	}

	/deep/ .uni-card .uni-card__content[data-v-19622063] {
		padding: 10px;
		font-size: 14px;
		color: #6a6a6a;
		line-height: 22px;
	}

	/deep/ .uni-card uni-card--border {
		padding: 10px 0;
	}
</style>